package md.mru.core.domains.type;

/**
 * Enum class contains constants mapped with
 * rows from order_type_groups table by id.
 *
 * @author sergiu.marin
 * @since 18.05.2014.
 */
public enum OrderStateType {
                       // id    // title
    EMPLOYMENT        (1,       "Ordin de angajare"),
    DISCHARGED        (2,       "Ordin de eliberare"),
    SUSPENDED         (3,       "Ordin de suspendare"),
    TRANSFER          (4,       "Ordin de transferare"),
    HOLIDAY           (5,       "Ordin de concediu"),
    AWAY              (6,       "Ordin de deplasare"),
    ADVANCEMENT       (7,       "Ordin de avansare"),
    STIMULATION       (8,       "Ordin de stimulare"),
    TRAINING          (9,       "Ordin de cursuri"),
    SANCTIONS         (10,      "Ordin de sanctiune"),
    ATTESTATION       (11,      "Ordin de atestare"),
    RESTORING         (12,      "Ordin de restabilire"),
    WORK_INCAPACITY   (13,      "Ordin de incapacitate de lucru"),
    RECALL            (14,      "Ordin de rechemare"),
    HOLIDAY_SUPPLEMENT(15,      "Ordin de adaugare zile la concediu");

    public final long id;
    public final String title;

    OrderStateType(long id, String title) {
        this.id = id;
        this.title = title;
    }

    public static OrderStateType valueOf(Long id) {
        for (OrderStateType o : OrderStateType.values()) {
            if (o.id == id) {
                return o;
            }
        }
        return null;
    }
}
